﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Data;
using System.Data.SqlClient;


public partial class Xwzx : System.Web.UI.Page
{
    public List<Model.NewsSite> alllists;
    protected DataTable xinwensj = null;
    protected int pageview, totalCount = 0;

    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
           fenye();
        }
   
      
    }
    
    private void fenye() //查看
    {
        PagedDataSource pds = new PagedDataSource();
      
        string sql = "Type=" + 1 + " and ";
        alllists = BLL.NewsSite.GetPageListBysql(this.AspNetPager1.CurrentPageIndex - 1, this.AspNetPager1.PageSize, sql + " 1=1 ", out totalCount);
        if (alllists != null && alllists.Count > 0)
        {
            AspNetPager1.RecordCount = totalCount;
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        }


       
     
  }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        fenye();
    }
}